<%@page contentType="text/html" pageEncoding="UTF-8" import="arocms.Constans"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@taglib prefix="ar" tagdir="/WEB-INF/tags"%>

<html:link action="/Links/LinkForm" styleClass="button">Add new</html:link>

<logic:notPresent name="<%=Constans.LINKS_LIST_PATH%>">
    <h1>No data available</h1>
</logic:notPresent>

<logic:present name="<%=Constans.LINKS_LIST_PATH%>">
    
    <ar:pager action="/Links/List.do" pageSize="6" parameterName="gerappa" collection="<%=Constans.LINKS_LIST_PATH%>"/>
    
    <logic:iterate name="<%=Constans.LINKS_LIST_PATH%>" id="link">
        <table class="linkContainer" cellspacing="0" cellpadding="0">
            <tr class="linkTopRow">
                <td class="linkId">${link.id}</td>
                <td class="linkAddress">
                    <html:link href="${link.address}">${link.title}</html:link>
                </td>
                <td class="linkMenu">
                    <html:link action="/Links/Delete" paramName="link" paramProperty="id" paramId="id">delete</html:link>
                    <html:link action="/Links/Edit"   paramName="link" paramProperty="id" paramId="id">edit</html:link>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    ${link.description}
                </td>
            </tr>
        </table>
        
    </logic:iterate>
</logic:present>